package com.shopnight.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName chat_private
 */
@TableName(value ="chat_private")
@Data
public class ChatPrivate implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 本人id
     */
    private Integer selfId;

    /**
     * 别人id
     */
    private Integer otherPeopleId;

    /**
     * 消息
     */
    private String message;

    /**
     * 发送时间
     */
    private Date sendingTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ChatPrivate other = (ChatPrivate) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSelfId() == null ? other.getSelfId() == null : this.getSelfId().equals(other.getSelfId()))
            && (this.getOtherPeopleId() == null ? other.getOtherPeopleId() == null : this.getOtherPeopleId().equals(other.getOtherPeopleId()))
            && (this.getMessage() == null ? other.getMessage() == null : this.getMessage().equals(other.getMessage()))
            && (this.getSendingTime() == null ? other.getSendingTime() == null : this.getSendingTime().equals(other.getSendingTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSelfId() == null) ? 0 : getSelfId().hashCode());
        result = prime * result + ((getOtherPeopleId() == null) ? 0 : getOtherPeopleId().hashCode());
        result = prime * result + ((getMessage() == null) ? 0 : getMessage().hashCode());
        result = prime * result + ((getSendingTime() == null) ? 0 : getSendingTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", selfId=").append(selfId);
        sb.append(", otherPeopleId=").append(otherPeopleId);
        sb.append(", message=").append(message);
        sb.append(", sendingTime=").append(sendingTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}